package Inherit.equals;

public class Manager extends Employee {
    private double bounds;

    public Manager(String name, double salary, int year, int month, int day) {
        super(name, salary, year, month, day);
        bounds=0.0;
    }

    public double getBounds() {
        return bounds;
    }

    public void setBounds(double bounds) {
        this.bounds = bounds;
    }

    @Override
    public boolean equals(Object obj) {

        if(!super.equals(obj)) return false;
        Manager other=(Manager)obj;

        //super.equals checked that this and other belong to the same class
        return bounds==other.bounds;
    }

    @Override
    public int hashCode() {
        return super.hashCode()+17*new Double(bounds).hashCode();
    }

    @Override
    public String toString() {
        return super.toString()+"[bonus="+bounds+"]";
    }
}
